<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<form action="">
		<input type="text" name='username'>
		<input type="text" name='pwd'>
	</form>
	<form action=""></form>
	<form action=""></form>

	<a href="http://www.baidu.com">百度</a>
	<a href="http://www.baidu.com">天猫</a>
	<a href="http://www.baidu.com">京东</a>

	<img src="./sunli/2.jpg" alt="">
	<img src="./sunli/3.jpg" alt="">
	<img src="./sunli/4.jpg" alt="">



	<script type="text/javascript">
	//获取所有的表单
	var form =document.forms;
	//通过name属性值获取input
	var inp = form[0].username;

	//通过elements获取

	var el =form[0].elements;

	// el[1].style.border = 'solid 2px yellow';
	el[1].value = 'ilikeyou';

	//inp.style.border = 'solid 2px blue';

	//console.log(el);


	// console.log(form[0]);

	//获取所有的a标签
	var as = document.links;

	as[1].href = 'http://www.qq.com';

	//获取所有的img标签
	var img = document.images;

	//改变图片
	img[1].src = './sunli/6.jpg';

	img[1].setAttribute('width','100px');

	console.log(img);

	</script>
</body>
</html>